n=eval(input())
answer=list()
s=input().split()
answer.append(s[1])
answer.append(s[0])
answer.append(eval(s[2])+eval(s[3])+eval(s[4]))
for i in range(0,n-1):
    s=input().split(' ')
    tmp=eval(s[2])+eval(s[3])+eval(s[4])
    if tmp>answer[2]:
        answer[0]=s[1]
        answer[1]=s[0]
        answer[2]=tmp
print(answer[0],answer[1],answer[2])